<?php

use yii\bootstrap\Html;
use yii\widgets\ActiveForm;
use backend\models\Auth;

$this->registerJsFile('@web/js/admin.js', [
    'depends' => [
        'backend\assets\AppAsset',
    ],
    'position' => \yii\web\View::POS_END
]);
/* @var $this yii\web\View */
/* @var $model backend\models\User */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="row">
    <?php $form = ActiveForm::begin(); ?>
    <div class="col-lg-6">
        <div class="panel panel-info">
            <div class="panel-heading">
                <?= $model->isNewRecord ? '发布管理员' : '修改管理员' ?>
            </div>
            <div class="panel-body">
                <?= $form->field($model, 'username')->textInput(['maxlength' => 50]) ?>
                <?= $form->field($model, 'password')->passwordInput(['maxlength' => 50]) ?>
                <?= $form->field($model, 'role')->dropDownList(Auth::getRoleOptions()); ?>
                <div class="form-group">
                    <?= Html::submitButton($model->isNewRecord ? Yii::t('app', '保存') : Yii::t('app', '修改'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
                </div>
            </div>

        </div>
    </div>
    <?php ActiveForm::end(); ?>

</div>